#ifndef WF_DRAWELLIPSEAXIS_H
#define WF_DRAWELLIPSEAXIS_H

#include "pf_previewactioninterface.h"
#include "pf_ellipse.h"
#include "gui_export.h"

/**
 * This action class can handle user events to draw ellipses
 * with a center point and the endpoints of minor and major axis.
 *
 */
class GUI_EXPORT WF_DrawEllipseAxis : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetCenter,   /**< Settinge the center.  */
        SetMajor,    /**< Setting endpoint of major axis. */
        SetMinor,    /**< Setting minor/major ratio. */
        SetAngle1,   /**< Setting start angle. */
        SetAngle2    /**< Setting end angle. */
    };

public:
    WF_DrawEllipseAxis(PF_Container& container,
                             PF_GraphicView& graphicView,
                             bool isArc);
    ~WF_DrawEllipseAxis();
	
	static QAction* createGUIAction(LX_Define::ActionType type, QObject* /*parent*/);

    virtual void init(int status=0);
	
    virtual void trigger();
	
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);

	virtual void coordinateEvent(PF_CoordinateEvent* e);
    virtual void commandEvent(PF_CommandEvent* e);
	virtual PF_StringList getAvailableCommands();

    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

protected:
    /** Center of ellipse */
    PF_Vector center;
    /** Endpoint of major axis */
    PF_Vector major;
    /** Ratio major / minor */
    double ratio;
    /** Start angle */
    double angle1;
    /** End angle */
    double angle2;
    /** Do we produce an arc (true) or full ellipse (false) */
    bool isArc;
};

#endif
